#ifndef __TOOL_H_
#define __TOOL_H_
#include "MyString.h"
#include "DynamicArray.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#define true 1
#define false 0
#define Map_Size 6

struct Player
{
    int HP;
    int attack;
    int x;
    int y;
    int pocket;
};

struct Monster
{
    MyString name;
    int HP;
    int attack;
    int x;
    int y;
};

struct LuckyWheel
{
    MyString name;
    int HP;
    int AP;
    int Value;
};

struct Treasure
{
    MyString name;
    int ap;
    int blood;
    int x;
    int y;
};

struct Coin
{
    MyString name;
    int value;
    int x;
    int y;
};
//NPC A
struct NonPlayerA
{
    MyString nameA;
    int value;
    int x;
    int y;
};
//NPC B
struct NonPlayerB
{
    MyString nameB;
    int value;
    int x;
    int y;
};
//NPC C
struct NonPlayerC
{
    MyString nameC;
    int value;
    int x;
    int y;
};
int GetRandNumber(int max);

void PrintMap(char (*p)[Map_Size], struct Player *player);
void InitBoard(char (*p)[Map_Size]);

void InitPlayer(struct Player *player);

void BloodVolume(struct Player *player);


struct Monster *CreateMonster(const char *name, int HP, int attack);
void InitMonsters(struct DynamicArray *array);


struct Treasure *CreateTreasure(const char *name, int blood, int ap);
void InitTreasure(struct DynamicArray *array);
int Gain(struct Player *player, struct Treasure *treasure);


struct Coin *CreateCoin(const char *name, int value);
void InitCoin(struct DynamicArray *array);
struct LuckyWheel *CreateLWheel(const char *name, int HP, int AP, int Value);
void InitLuckyWheel(struct DynamicArray *array);
int Money(struct Player *player, struct Coin *coin);
int Luckydraw(struct Player *player);

int Battle(struct Player *player, struct Monster *monster);
void MakeMove(struct Player *player, char symbol);

struct LuckyWheel *GetRandomLWheel(struct DynamicArray *array);


//NPC1
void InitNonPlayerA(struct DynamicArray *array);
struct NonPlayerA *CreateNonPlayerA(const char *name, int value);
int MissA(struct Player *player, struct NonPlayerA *NPC);
//NPC2
void InitNonPlayerB(struct DynamicArray *array);
struct NonPlayerB *CreateNonPlayerB(const char *name, int value);
int MissB(struct Player *player, struct NonPlayerB *NPC);
//NPC3
void InitNonPlayerC(struct DynamicArray *array);
struct NonPlayerC *CreateNonPlayerC(const char *name, int value);
int MissC(struct Player *player, struct NonPlayerC *NPC);

#endif